package com.ricky;

import com.ricky04.Ricky04Config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;

@EnableAutoConfiguration
@ComponentScan(basePackages = {"com.ricky","com.ricky02","com.ricky03"},basePackageClasses = {Ricky04Config.class})
//@Import({Ricky04Config.class})
public class SpringBootApplication06_3 {

    @Bean
    public Object createObject(){
        return new Object();
    }
    /**
     * 开启SpringBoot服务
     * @param args
     */
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(SpringBootApplication06_3.class, args);

        String[] names = context.getBeanDefinitionNames();
        for (String name:names){
            System.out.println(name);
        }

        context.close();
    }
}